import requests
token = "c704ae0f-ea22-4eff-b630-099a311e5628"
id = '1525025580091768832'
resp = requests.post(url="http://ihrm-test.itheima.net/api/sys/user",
                     headers= {"Authorization" : token},
                     json={"username":"hha","mobile":"13469317676","workNumber":"1324312"})
print("增加员工",resp.json())

resp = requests.put(url="http://ihrm-test.itheima.net/api/sys/user/" + id,
                    headers={"Authorization": token},
                    json={"username": "惠主播"})
print("修改员工",resp.json())

resp = requests.get(url="http://ihrm-test.itheima.net/api/sys/user/" + id,
                    headers={"Authorization": token})

print("查询员工", resp.json())

resp = requests.delete(url="http://ihrm-test.itheima.net/api/sys/user/" + id,
                       headers={"Authorization": token})

print("删除员工", resp.json())




# import requests
#
# token = "2c9f0d4e-9ccb-4ae0-ab37-281db1685585"
# id = "1524641546572464128"
#
# """添加员工"""
# # token需要登录后, 获取. 这里暂时先用postman发个登录请求, 获取token
# resp = requests.post(url="http://ihrm-test.itheima.net/api/sys/user",
#                      headers={"Authorization": token},
#                      json={"username": "hzb", "mobile": "13212234560", "workNumber": "123412412412"})
#
# print("添加员工", resp.json())
#
# """修改员工"""
# resp = requests.put(url="http://ihrm-test.itheima.net/api/sys/user/" + id,
#                     headers={"Authorization": token},
#                     json={"username": "惠主播"})
#
# print("修改员工", resp.json())
#
# """查询员工"""
# resp = requests.get(url="http://ihrm-test.itheima.net/api/sys/user/" + id,
#                     headers={"Authorization": token})
#
# print("查询员工", resp.json())
#
# """删除员工"""
# resp = requests.delete(url="http://ihrm-test.itheima.net/api/sys/user/" + id,
#                        headers={"Authorization": token})
#
# print("删除员工", resp.json())